#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>

void random(int a,int b);
int judge(int a, int b);

double result=0;

int main()
{
    int num1=0,num2=0;
    int yesorno;
    random(num1,num2);
    yesorno = judge(num1,num2);
    if(yesorno == 1)
    {
        printf("Right!");
    }
    if(yesorno == 0)
    {
        printf("Not correct!");
    }
    return 0;
}

void random(int a,int b)
{
    srand(time(NULL));
    a = rand() % 10 + 1;
    b = rand() % 10 + 1;
    printf("Question:%d / %d\n",a,b);
    result = (double)a / b;
    return;
}

int judge(int a,int b)
{
    double answer;
    printf("Please input answer:");
    scanf("% lf",&answer);
    if(fabs(result-answer)<0.1)
    {
        return 1;
    }
    else
    {
        return 0;
    }
}